#include<iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
    string intToRoman(int num) {
        int a[] = {1000,900,500,400,100,90,50,40,10,9,5,4,1};
        string s[] = { "M","CM","D" ,"CD","C","XC","L","XL","X","IX","V","IV","I" };
        string ans = "";
        for (int i = 0; i < 13; i++)
        {
            while (num >= a[i])
            {
                num -= a[i];
                ans += s[i];
            }
        }
        return ans;
    }
};
int main()
{
    Solution sol;
    cout << sol.intToRoman(1994) << endl;

}